package cn.itcast.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

public class BasicEntity implements Serializable {

    public BasicEntity() {
    }

    @Override
    public String toString() {
        if(this!=null) return JSON.toJSONString(this);
        else return null;
    }

    public JSONObject toJson(){
        return JSON.parseObject(this.toString());
    }
}
